/**
 * @Author: colpu
 * @Date: 2025-03-29 17:57:34
 * @LastEditors: colpu ycg520520@qq.com
 * @LastEditTime: 2025-04-02 19:54:31
 * @
 * @Copyright (c) 2025 by colpu, All Rights Reserved.
 */
import shell from "shelljs"; // 脚本执行
import _ from "lodash";

/**
  @description 发布命令
  @cmd npm run shipit
*/
export default async function shipit(env, argv) {
  process.env.NODE_ENV = env;
  const otherArgv = argv.split(" ").splice(2);
  const defaultShift =
    "--shipitfile ./node_modules/@colpu/cli/config/shipit.js";
  const bash = `shipit ${env} deploy ${
    otherArgv.length > 0 ? otherArgv.join(" ") : defaultShift
  }`;
  shell.echo(bash);
  shell.exec(bash);
}
